/* 
 * File:   FiltreBlue.cpp
 * Author: amouro-m
 * 
 * Created on 15 mai 2010, 13:36
 */

#include "FiltreBlue.hpp"
#include "FractalPrinter.h"

FiltreBlue::FiltreBlue():
Filtre("Filtre composante bleue")
{}

FiltreBlue::~FiltreBlue() {}

void
FiltreBlue::compute(SDL_Surface* area, const unsigned int x, const unsigned int y) const
{
    Uint8 red, green, blue;
    Uint32 color = FractalPrinter::getpixel(area, x,y);
    SDL_GetRGB(color, area->format, &red, &green, &blue);

    color = SDL_MapRGB(area->format, 0, 0, blue);
    FractalPrinter::putpixel(area, x, y, color);
}